package ch.nostromo.tiffanys.tests.problems;

import ch.nostromo.tiffanys.game.GameController;
import ch.nostromo.tiffanys.game.GameControllerException;
import ch.nostromo.tiffanys.game.game.GameState;
import ch.nostromo.tiffanys.game.player.PlayerEngine;
import ch.nostromo.tiffanys.tests.TestBase;

public class TestMates extends TestBase {

  public void testMates() throws ClassNotFoundException, GameControllerException {
    PlayerEngine white = this.getEngineWithFixedDepth(6);
    PlayerEngine black = this.getEngineWithFixedDepth(6);
    
    String fenInput = "k7/r7/r7/8/8/8/p7/K7 b KQkq - 0 3";
    
    GameController gc = new GameController(white, black, fenInput);

    gc.computeNextMoveNow(true);
    gc.computeNextMoveNow(true);
    gc.computeNextMoveNow(true);
    gc.computeNextMoveNow(true);
    gc.computeNextMoveNow(true);
    
    GameState gs = gc.getCurrentGameState();
    
    assertTrue(gs.blackMates());
  }
  
}
